#Contributor: MacWolf <macwolf@archlinux.de>
# Update: Carbon Jiao <http://archlive-pkg.googlecode.com>
# Disabled qt...

pkgname=vlc-git
pkgver=20090424
pkgrel=1
pkgdesc="VideoLAN Client is a multi-platform MPEG, VCD/DVD, and DivX player.Development GIT Version."
depends=('libmad' 'libmpeg2' 'ffmpeg' \
         'hal' 'fluidsynth' 'zvbi' 'lua'\
         'libdvbpsi' 'fribidi' 'sysfsutils' \
         'libdvdnav' 'libnotify' 'libdvdread' \
         'libmatroska' 'libcddb' 'libmpcdec'\
         'faad2' 'libmodplug' 'speex' 'sdl_image' \
	 'libxml2' 'libdca' 'libxv' 'avahi' 'taglib')
arch=(i686 x86_64)
makedepends=('a52dec' 'make' 'm4' 'pkgconfig' 'automake' 'autoconf' 'git' 'live-media>=2008.09.02')
install=vlc.install
url="http://www.videolan.org/vlc/"
license=(GPL)
conflicts=('vlc' 'vlc-svn' 'vlc-nightly')
provides=('vlc' 'vlc-svn' 'vlc-nightly')
source=()
md5sums=()

_gitroot=git://git.videolan.org/vlc.git
_gitname=vlc

build() {
cd $startdir/src

if [ -d $_gitname ]; then
	cd $_gitname && git pull origin
	cd ..
else
	git clone $_gitroot
fi

rm -rf $_gitname-build
#cp -r $_gitname $_gitname-build
git clone $_gitname $_gitname-build

msg "GIT checkout done or server timeout"

cd $_gitname-build

msg "Generating necessary files"

./bootstrap

msg "Generating done."

msg "Starting make..."

  [ "${CARCH}" = "i686" ] && EXTRAFEATURES="--enable-loader --disable-live555 --with-live555-tree=/usr/lib/live-media"
  [ "${CARCH}" = "x86_64" ] && EXTRAFEATURES="--enable-fast-install"

./configure --prefix=/usr --enable-dvdread --enable-dvdnav --enable-madi --enable-ffmpeg --disable-rpath --enable-faad --enable-v4l --enable-dvb --enable-dmo --enable-theora --enable-flac --enable-real --enable-realrtsp --enable-svg --enable-snapshot --disable-qt4 --disable-skins2 ${EXTRAFEATURES} || return 1

  make || return 1  
  make DESTDIR=$startdir/pkg install || return 1

  for res in 16 32 48; do
    install -D -m644 share/vlc${res}x${res}.png \
	$startdir/pkg/usr/share/icons/hicolor/${res}x${res}/apps/vlc.png || return 1
  done	

  install -D -m644 $startdir/src/vlc/share/applications/vlc.desktop \
	$startdir/pkg/usr/share/applications/vlc.desktop || return 1

  rm -rf ${startdir}/pkg/usr/lib/mozilla
}
